< previous page page_26 next page >

Page 26
continued
Table 2.1.
Data Field TypeSizeVBTypeComments
GUID16(none)Used to store Globally Unique Identifiers
INTEGER2Integer
LONG8Long
LONGBINARYV(none)Used for OLE objects
MEMOVStringLength varies up to 1.2 gigabytes
SINGLE4Single
TEXTVStringLength limited to 255

Note.gif
It is important to understand the difference between the Visual Basic data field types and the Visual Basic data types. The data field types are those recognized as valid data types within data tables. The data types are those types recognized by Visual Basic when defining variables within a program. For example, you can store the value 3 in a BYTE field in a data table, but you store that same value in an Integer field in a Visual Basic program variable.

Even though it is true that Visual Basic allows programmers to create database applications that can read and write data in several different data formats, all database formats do not recognize all data field types. For example, xBase data fields do not recognize a CURRENCY data field type. Before developing cross data-engine applications, you need to know exactly what data field types are needed and how they are to be mapped to various data formats. The various data formats are covered in Day 9, "Visual Basic and the Microsoft Jet Engine."
A number of things in Table 2.1 deserve additional comment:
· LONGBINARY data fields are for storing images and OLE objects. Visual Basic has no corresponding internal data type that maps directly to the LONGBINARY data field types. This information is usually stored as character data in Visual Basic. For example, a bitmap image would be stored in a LONGBINARY data table field, but it would be stored as a string variable in a Visual Basic program. Double-clicking a data-bound LONGBINARY field automatically invokes the local application that is registered to handle the stored OLE object.

 
< previous page page_26 next page >

If you like this book, buy it!